#include<bits/stdc++.h>
using namespace std;
#define int long long

bool check(int x) {
	while (x % 2 == 0) {
		x /= 2;
	}
	while (x % 3 == 0) {
		x /= 3;
	}
	while (x % 5 == 0) {
		x /= 5;
	}
	if (x == 1)
		return true;
	else
		return false;
}

signed main() {
	int n, m;
	while (cin >> n >> m && (n || m)) {
		int ans = 0;
		for (int i = n; i <= m; i++) {
			if (check(i))
				ans++;
		}
		cout << ans << endl;
	}
	return 0;
}
